import {
	request
} from "@/utils/request.js";
import $utils from "@/api/serverLink.js";
import store from '../store/idnex.js';
let aData = Date.parse(new Date());

const sslwxbdApi = (param, c, cmd) =>
	request({
		url: $utils.sslwxbdUrl(
			"c=" + c + "&v=" + "3.0" + "&t=" + aData + "&a=" + store.state.appid
		),
		method: "POST",
		params: {
			cmd,
			base: wx.getStorageSync("baseinfopro"),
			param,
		},
		c,
		type: "sslwxbdApi"
	});

const apiMixUrlApi = (param, c, cmd) =>
	request({
		url: $utils.apiMixUrl(`&a=${store.state.appid}` + "&c=" + c),
		method: "POST",
		params: {
			cmd,
			base: wx.getStorageSync("baseinfopro"),
			param,
		},
		c,
		type: "apiMixUrlApi"
	});
	
	const apiMixUrlApis = (param, c, cmd) =>
		request({
			url: $utils.apiMixUrl("&a=dyxzy" + "&c=" + c),
			method: "POST",
			params: {
				cmd,
				base: wx.getStorageSync("baseinfopro"),
				param,
			},
			c,
			type: "apiMixUrlApis"
		});

const apiMixUrlKeyApi = (param, c, cmd) =>
	request({
		url: $utils.apiMixUrlKey(`&a=${store.state.appid}` + "&c=" + c),
		method: "POST",
		params: {
			cmd,
			base: wx.getStorageSync("baseinfopro"),
			param,
		},
		c,
		type: "apiMixUrlKeyApi"
	});

const bsqUrl = (param, c, cmd) =>
	request({
		url: $utils.bsqUrl(
			"c=" + c + "&v=" + "3.0" + "&t=" + aData + "&a=" + store.state.appid
		),
		method: "POST",
		params: {
			cmd,
			base: wx.getStorageSync("baseinfopro"),
			param,
		},
		c,
		type: "bsqUrl"
	});
const wycUrl = (param, c, cmd) =>
	request({
		url: $utils.wycUrl("c=" + c + "&v=" + "4" + "&a=" + store.state.appid),
		method: "POST",
		params: {
			cmd,
			base: wx.getStorageSync("baseinfopro"),
			param,
		},
		c,
		type: "wycUrl"
	});
const wycUrlApi = (params) =>
	request({
		url: $utils.wycUrlApi(),
		method: "POST",
		params,
		type: "apiMixUrlKeyApi"
	});
const sslbiz = (param, c, cmd) =>
	request({
		// url: $utils.sslbiz("&c=" + c ),
		url: $utils.sslbiz(`&a=${store.state.appid}` + "&c=" + c),
		method: "POST",
		params: {
			cmd,
			base: uni.getStorageSync("baseinfopro"),
			param,
		},
		c,
	});
export {
	apiMixUrlApis,
	sslwxbdApi,
	apiMixUrlApi,
	apiMixUrlKeyApi,
	bsqUrl,
	wycUrl,
	sslbiz,
	wycUrlApi
};